package com.example.doctorserver.controller;

import com.example.doctorserver.dto.CiReportDTO;
import com.example.doctorserver.dto.CiReportDetailedDTO;
import com.example.doctorserver.pojo.Checkitemdetailed;
import com.example.doctorserver.pojo.Orders;
import com.example.doctorserver.response.ApiRestResponse;
import com.example.doctorserver.service.CiReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/ciReport")
public class CiReportController {

    @Autowired
    private CiReportService ciReportService;


    @PostMapping("/listCiReport")
    public ApiRestResponse<List<CiReportDetailedDTO>> listCiReport(@RequestBody Orders orders){

        System.out.println(orders.getOrderId());

        Integer orderId= orders.getOrderId();

        List<CiReportDetailedDTO> list=ciReportService.listCiReport(orderId);

        return ApiRestResponse.success(list);


    }


}
